<?php
/*
	Version   :  1.1
	Created   :  20081002
	Modified  :  20090927
	Author    :  Pablo Ramirez
	co-Author :
	Descr     : Controlador "Ports"
	Changelog : 1.0 - Version Inicial
				1.1 - Control de Acceso
*/
class PortsController extends AppController
{
	var $name       = 'Ports';
	var $helpers    = array('Html','Javascript');
	var $scaffold;
	
	function add() {
		$this->checkSession('admin');
		if (!empty($this->data)){
			if ($this->Port->save($this->data)){
				$this->flash('Puerto Ingresado','/ports');
			}
		}
	}
	
	function edit($id = null) {
		$this->checkSession('admin');
		$this->Port->id = $id;
		
		if (empty($this->data)){
			$this->data = $this->Port->read();
		}else{
			if ($this->Port->save($this->data)){
				$this->flash('Item Editado','/ports');
			} else {
				$this->Session->setFlash('Error al editar el Item');
			}
		}
	}
}
?>